package cn.bx.consumer.service;

import org.example.pojo.Answer;
import org.example.pojo.Question;
import org.example.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("bid")
public interface MainFeignClient {
    @RequestMapping(value = "searchAll", produces = "application/json;charset=utf-8")
    public AjaxResult searchAll();

    @RequestMapping(value = "getBy", produces = "application/json;charset=utf-8")
    public AjaxResult getBy(@RequestParam( "id") long id);

    @RequestMapping(value = "addQuestion", produces = "application/json;charset=utf-8")
    public AjaxResult addQuestion(Question question);

    @RequestMapping(value = "addAnswer", produces = "application/json;charset=utf-8")
    public AjaxResult addAnswer(Answer answer);

    @RequestMapping(value = "getAnswer", produces = "application/json;charset=utf-8")
    public AjaxResult getAnswer(@RequestParam(name = "qid") long id);
}
